package com.liujiaqi.helloknife4j.controller;

import com.liujiaqi.helloknife4j.entity.User;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
@Tag(name = "用户信息管理")
public class UserController {

  @GetMapping("/{id}")
  @Operation(summary = "根据id获取用户信息")
  public User getById(@Parameter(description = "用户ID") @PathVariable Integer id) {
    User user = new User();
    user.setId(id);
    user.setName("liujiaqi");
    user.setAge(18);

    return user;
  }
}
